package com.example.selfcontrol.controller;

import com.qiniu.util.Auth;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class TokenController {
    String accessKey = "K84tokavUSDJKSAKqQsalTDSfGoIAtKyC3QI-Z5s";
    String secretKey = "zvmRQM_AZE0DGMfBiUMSSrGXwrZoCm8kkpCtvw9h";
    String bucket = "gdpu";


    Auth auth = Auth.create(accessKey, secretKey);
    String upToken = auth.uploadToken(bucket);


    @GetMapping("/api/getToken")
    @ApiOperation("返回七牛云图床Token")
    public String getUpToken() {
        return upToken;
    }

}
